1. Field of Invention
The present invention relates to an image processing method. More particularly, the present invention relates to a method for generating an all-in-focus image.
2. Description of Related Art
With the development of the technologies, the electronic products are highly popular and are widely used in many countries. The consumer electronic products even become indispensable tools to people's daily life. Taking the digital camera as an example, since there are many product brands, the market for selling the digital cameras is highly competitive. The manufacturers devote themselves to develop the cameras with more powerful functions to attract consumers' attentions.
Generally, the digital camera needs to provide not only a good image quality, but also high focus accuracy and focusing speed which are the concerning factors for the consumers while buying the electronic products. However, as for the current optical system, the depths of field of the objects in the three-dimensional scene are different from each other so that it is impossible to capture a clear all-in-focus image during a single image shooting. That is, due to the limitation of the optical properties of the lens, one of the depths of field is selected for focusing while the digital camera captures the image. Thus, the images of the objects which are not located within the selected depth of field are blurred.
The all-in-focus image re-generation is a technique developed for solving the aforementioned problem. However, the recent all-in-focus re-generation is performed without considering the information about the brightness and color. Thus, it is easy to lead to paling the colors of the generated all-in-focus image and even damage the original color performance of the edge of the object. Moreover, the noise distribution in the bright-and-dark region of the image is not uniform. Thus, it is easy that the all-in-focus generated simply by composing images fails to provide good image quality while the all-in-focus is generated without concerning the noises of the bright-and-dark region.